package top.go2do.common.controller;

import org.springframework.web.bind.annotation.*;
import top.go2do.common.annotation.UserInfoFill;
import top.go2do.common.module.UserInfoBO;
import top.go2do.common.module.pageQuery.PageResult;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description
 * @Author xingyj
 * @CreateTime 2025/6/12 12:57
 */
public interface TomatoController<DetailVO, CreateForm, ModifyForm, IdType, QueryCondition, QueryAllCondition, ListVO> {

    @PostMapping
    DetailVO create(@RequestBody CreateForm createForm, @UserInfoFill UserInfoBO userInfo);

    @PatchMapping("/{id}")
    void modifyById(@PathVariable IdType id, @RequestBody ModifyForm modifyForm, @UserInfoFill UserInfoBO userInfo);

    @DeleteMapping("/{id}")
    void removeById(@PathVariable IdType id, @UserInfoFill UserInfoBO userInfo);

    @GetMapping("/{id}")
    DetailVO getById(@PathVariable IdType id);

    @GetMapping
    default PageResult<ListVO> pageQuery(QueryCondition queryCondition) {
        PageResult<ListVO> pageResult = new PageResult<>();
        pageResult.setList(new ArrayList<>(0));
        return pageResult;
    };

    @GetMapping("/all")
    default List<ListVO> listAll(QueryAllCondition condition) {
        return new ArrayList<>(0);
    };


    @PostMapping("/mine")
    default PageResult<ListVO> myPageQuery(@UserInfoFill UserInfoBO userInfo, @RequestBody QueryCondition queryCondition) {
        PageResult<ListVO> pageResult = new PageResult<>();
        pageResult.setList(new ArrayList<>(0));
        return pageResult;
    };

    @PostMapping("/mine-all")
    default List<ListVO> myListAll(@UserInfoFill UserInfoBO userInfo, @RequestBody QueryAllCondition condition) {
        return new ArrayList<>(0);
    };

}
